﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GtsServer.Common;
using System.IO;

namespace GtsServer.Service.Controller
{
    public class CommonController
    {
        public static T SetObjectValue<T>(T model, string input)
        {
            //input = input.Replace("\\","\\\\");
            return JsonHelper.ParseJSON<T>(input);
        }

        public static T SetObjectValue<T>(T model, Stream input)
        {
            string param = "";
            using (StreamReader sr = new StreamReader(input))
            {
                param = sr.ReadToEnd();
                LogHelper.WriteLog(param);
                //param = param.Replace("\\", "\\\\");
                //LogHelper.WriteLog(param);
            }
            return JsonHelper.ParseJSON<T>(param);
        }
    }
}
